package warmachineroster.presentation.command;

import org.eclipse.gef.commands.Command;

import warmachineroster.RosterElement;
import warmachineroster.UnitRosterElement;

public class UnitAttachmentRosterElementRemoveCommand extends Command {

	private RosterElement rosterElement;
	private UnitRosterElement motherUnit;

	public void setMotherUnit(UnitRosterElement motherUnit) {
		this.motherUnit = motherUnit;
	}

	public void setRosterElement(RosterElement baseUnit) {
		this.rosterElement = baseUnit;
	}

	@Override
	public void execute() {
		motherUnit.getUnitAttachment().remove(rosterElement);
	}

	@Override
	public void undo() {
		motherUnit.getUnitAttachment().add(rosterElement);
	}
	
}
